package com.ruoyi.web.controller.net;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.net.domain.BusiL2VpnQoslsp;
import com.ruoyi.net.service.IBusiL2VpnQoslspService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 业务-L2 VPN qos-lspController
 * 
 * @author net
 * @date 2024-12-15
 */
@Api(tags = "业务-L2 VPN qos-lsp")
@RestController
@RequestMapping("/busi/l2/vpn/qoslsp")
public class BusiL2VpnQoslspController extends BaseController
{
    @Autowired
    private IBusiL2VpnQoslspService busiL2VpnQoslspService;

    /**
     * 查询业务-L2 VPN qos-lsp列表
     */
    @ApiOperation(value = "查询业务-L2 VPN qos-lsp列表", httpMethod = "GET")
    @PreAuthorize("@ss.hasPermi('net:qoslsp:list')")
    @GetMapping("/list")
    public TableDataInfo list(BusiL2VpnQoslsp busiL2VpnQoslsp)
    {
        startPage();
        List<BusiL2VpnQoslsp> list = busiL2VpnQoslspService.selectBusiL2VpnQoslspList(busiL2VpnQoslsp);
        return getDataTable(list);
    }

    /**
     * 导出业务-L2 VPN qos-lsp列表
     */
    @ApiOperation(value = "导出业务-L2 VPN qos-lsp列表", httpMethod = "POST")
    @PreAuthorize("@ss.hasPermi('net:qoslsp:export')")
    @Log(title = "业务-L2 VPN qos-lsp", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BusiL2VpnQoslsp busiL2VpnQoslsp)
    {
        List<BusiL2VpnQoslsp> list = busiL2VpnQoslspService.selectBusiL2VpnQoslspList(busiL2VpnQoslsp);
        ExcelUtil<BusiL2VpnQoslsp> util = new ExcelUtil<BusiL2VpnQoslsp>(BusiL2VpnQoslsp.class);
        util.exportExcel(response, list, "业务-L2 VPN qos-lsp数据");
    }

    /**
     * 获取业务-L2 VPN qos-lsp详细信息
     */
    @ApiOperation(value = "获取业务-L2 VPN qos-lsp详细信息", httpMethod = "GET")
    @PreAuthorize("@ss.hasPermi('net:qoslsp:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(busiL2VpnQoslspService.selectBusiL2VpnQoslspById(id));
    }

    /**
     * 新增业务-L2 VPN qos-lsp
     */
    @ApiOperation(value = "新增业务-L2 VPN qos-lsp", httpMethod = "POST")
    @PreAuthorize("@ss.hasPermi('net:qoslsp:add')")
    @Log(title = "业务-L2 VPN qos-lsp", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BusiL2VpnQoslsp busiL2VpnQoslsp)
    {
        return toAjax(busiL2VpnQoslspService.insertBusiL2VpnQoslsp(busiL2VpnQoslsp));
    }

    /**
     * 修改业务-L2 VPN qos-lsp
     */
    @ApiOperation(value = "修改业务-L2 VPN qos-lsp", httpMethod = "PUT")
    @PreAuthorize("@ss.hasPermi('net:qoslsp:edit')")
    @Log(title = "业务-L2 VPN qos-lsp", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BusiL2VpnQoslsp busiL2VpnQoslsp)
    {
        return toAjax(busiL2VpnQoslspService.updateBusiL2VpnQoslsp(busiL2VpnQoslsp));
    }

    /**
     * 删除业务-L2 VPN qos-lsp
     */
    @ApiOperation(value = "删除业务-L2 VPN qos-lsp", httpMethod = "DELETE")
    @PreAuthorize("@ss.hasPermi('net:qoslsp:remove')")
    @Log(title = "业务-L2 VPN qos-lsp", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(busiL2VpnQoslspService.deleteBusiL2VpnQoslspByIds(ids));
    }
}
